package com.ssy.lingxi.marketing.model.constant;

import java.util.Arrays;

/**
 * 赠送促销类型: 1-满额赠 2-买商品赠
 * @author yzc
 * @version 2.0.0
 * @date 2021/9/9
 */
public enum GiveTypeEnum {

    FULL_MONEY(1, "满额赠"),
    BUY_GOODS(2, "买商品赠"),
    ;

    private final Integer code;
    private final String message;

    GiveTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessage(Integer code) {
        return Arrays.stream(GiveTypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().map(GiveTypeEnum::getMessage).orElse("");
    }


}
